<?php
class SahORMException extends Exception
{
  const QUERY_ERROR = 1;
  const BAD_PARENT_ARGUMENT = 2;
  
  private $_sql_error;
  private $_sql_code;
  
  public function __construct($message, $code = 0, $sql_error = NULL,
    $sql_code = NULL)
  {
    parent::__construct($message, $code);
    $this->_sql_error = $sql_error;
    $this->_sql_code = $sql_code;
  }
  
  public function getSqlError()
  {
    return $this->_sql_error;
  }
  
  public function getSqlCode()
  {
    return $this->_sql_code;
  }
}